package com.wsx.ones.monitor.core.loader;

import com.wsx.ones.monitor.core.common.ChannelState;
import com.wsx.ones.monitor.core.serialize.RpcSerializeProtocol;

/**
 * 参数公用化处理
 * Created by wangshuaixin on 17/2/7.
 */
public abstract class RpcServerBase {

    //当前系统的可用cpu线程
    public static final int PROCESS = Runtime.getRuntime().availableProcessors() * 2;

    //服务状态一般只是做状态改变的标示，使用volatile最合适确保安全
    protected volatile ChannelState state = ChannelState.UNINIT;

    //系统默认的序列化
    protected RpcSerializeProtocol rpcSerializeProtocol = RpcSerializeProtocol.HESSIONSERIALIZE;

    public void setRpcSerializeProtocol(RpcSerializeProtocol protocol) {
        this.rpcSerializeProtocol = protocol;
    }
}
